#ifndef STRAY_TEXTURE_TEXTURE_H
#define STRAY_TEXTURE_TEXTURE_H

#include <SmartPtr/SharedPtr.h>
#include <Container.h>
#include <Graphics.h>
#include "../Resource.h"

namespace Stray {
namespace Resource {

struct TextureCreationParam
{
	typedef Stray::Vector<Stray::Uint8>::type TextureData;

	Stray::Core::Graphics::TextureDesc textureDesc_;
	TextureData data_;
};

class Texture : public Resource
{
	friend class TextureFactory;
public:
	static const char type_[];

private:
	typedef Stray::Core::Graphics::TexturePtr TexturePtr;

	Texture(const ResourceID& id);
public:
	void load(Bool isAsync = B_FALSE);
private:
	TexturePtr spTexture_;

	void build(const TextureCreationParam& param);
};

typedef Stray::SharedPtr<Texture>::type TexturePtr;

}
}

#endif